package org.jcc.core.cs.generic.bigger;

public class NormalBigger {
	
	public static void main(String[] args) {
		String biggerString = bigger("hello", "hi");
		Integer biggerInteger = bigger(new Integer(8), new Integer(5));
		Foo biggerFoo = bigger(new Foo("f1"), new Foo("f2"));
		
		System.out.println(biggerString);
		System.out.println(biggerInteger);
		System.out.println(biggerFoo);
	}

	public static String bigger(String b1, String b2) {
		return b1.compareTo(b2) > 0 ? b1 : b2;
	}
	
	public static Integer bigger(Integer b1, Integer b2) {
		return b1.compareTo(b2) > 0 ? b1 : b2;
	}
	
	// ...
	public static Foo bigger(Foo b1, Foo b2) {
		return b1.compareTo(b2) > 0 ? b1 : b2;
	}
}
